<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>修改信息|驴友天地</title>
<meta name="keywords" content="" />
<meta name="description" content="" />
<link href="<%=path %>/style/style.css" rel="stylesheet" type="text/css" media="screen" />
<link href="<%=path %>/style/personal.css" rel="stylesheet" type="text/css" />
<script src="<%=path %>/script/jquery-1.7.2.min.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="<%=path %>/css/imgareaselect-animated.css" />
<script type="text/javascript" src="<%=path %>/script/jquery.min.js"></script>
<script type="text/javascript" src="<%=path %>/script/jquery.imgareaselect.pack.js"></script>
<script type="text/javascript" src="<%=path %>/datajs/data.js"></script>
<script type="text/javascript" src="<%=path %>/datajs/picker.js"></script>

</head>
<script type="text/javascript">
$(document).ready(function () {
  $('img#bee').imgAreaSelect({aspectRatio:'1:1',handles:true});
});
$('img#bee').imgAreaSelect({
    onSelectEnd: function (img, selection) {
        alert('width: ' + selection.width + '; height: ' + selection.height);
    }
});
var container = null;
container = document.getElementById("pcd");
var picker_1 = new AreaPicker(container ,"AreaPicker_1" ,1).init().bind();

container = document.getElementById("pce");
var picker_2 = new AreaPicker(container ,"AreaPicker_2" ,2);
picker_2.init().bind();

container = document.getElementById("pcf");
var picker_3 = new AreaPicker(container ,"AreaPicker_2" ,3);
picker_3.init();
picker_3.bind();

//页面初始化*******************************
//全局变量
var userid="";
var dd="";
var listmem;
var nowuser;
var memnum=0;
//初始化旅游记忆导读
function inituserid(){
	$.ajax({
		type:"post", //请求方式
		url:"<%=path %>/getNowSession", //发送请求地址
		data:{ //发送给数据库的数据
		},
		//请求成功后的回调函数有两个参数
		success:function(data,textStatus){
		  	if(!data && typeof(data)!="undefined" && data!=0){
				alert("请在首页进行登录后访问本页");
				location.href="index.jsp";
			}
			else{	
				nowuser = eval("("+data+")");
				userid=nowuser.user_id;
				userinfoinit();	
				$('#personalnav').css("display","block");
				refresh();
				var loopp = setInterval("refresh()",10000);
			}
		}
	});
}
//初始化个人信息
function logout(){
	location.href="<%=path %>/deleteSession";
}
function userinfoinit(){

	var as="";
	as = as + "<img class='nameimg' src='<%=path %>/"+nowuser.user_headphoto+"' />";
	as = as + "<a href='javascript:void(0);'><span id='name'>"+nowuser.user_name+"</span></a>";
	as = as + "<div id='userintro'>";
	as = as + "<p><input type='button' id='sixin' value='私信' onclick='gotomysixin()' /><input type='button' value='退出' onclick='logout()' /></p>";
	as = as + "<p>"+nowuser.user_location+"</p>";
	as=as+"<p>粉丝数："+nowuser.followed_num+"</p>";
	as=as+"</div>";
	as=as+"<div id='shortintro'>";
	as=as+"<p>爱好："+nowuser.user_hobby+"</p>";
	as=as+"<p>"+nowuser.user_motto+"</p>";
	as=as+"<br /><input type='button' value='发布旅游记忆' style='margin-left:30px;' onclick='writememo()' />";
	as=as+"<input type='button' value='发布结伴游信息' onclick='writetog()' />";		
	as=as+"</div>";
	//alert(as);
	$('#userinfo').append(as);
}
function writememo(){
	window.location.href="<%=path %>/page/writemem.jsp";
}
function writetog(){
	window.location.href="<%=path %>/page/writetogether.jsp";
}
//右边浮动框****************************************
function opensxmini(){
	$('#sxmini').css("display","block");
	$('#sxminiclo').css("display","block");
	closecommentmini();
}
function opencommentmini(){
	$('#commentmini').css("display","block");
	$('#commentminiclo').css("display","block");
	closesxmini();
}
function closesxmini(){
	$('#sxmini').css("display","none");
	$('#sxminiclo').css("display","none");
}
function closecommentmini(){
	$('#commentmini').css("display","none");
	$('#commentminiclo').css("display","none");
}
function refresh(){
	
	sxajax();
	reflectajax();
}
function sxajax(){
	$.ajax({
		type:"post", //请求方式
		url:"<%=path %>/getUnreadMessage", //发送请求地址
		data:{ //发送给数据库的数据
		},
		//请求成功后的回调函数有两个参数
		success:function(data,textStatus){
			 var dataobj = eval("("+data+")");
			 var ss = "";
			 for(var i=0;i<dataobj.length;i++){
				 ss = ss+"<li><span><a href='<%=path %>/getUserIndexById?userid="+dataobj[i].sendid+"' target='_blank'>"+dataobj[i].sendername+"</a>来信<a href='<%=path %>/viewMessageDetail?messageid="+dataobj[i].messageid+"' target='_blank'>"+dataobj[i].messagetitle+"</a></span></li>";
			 }
			 $('#sxminiin').html(ss);
			 $('#sxnuminit').html("("+dataobj.length+")");
		}
	});
}
function reflectajax(){
	$.ajax({
		type:"post", //请求方式
		url:"<%=path %>/getUnreadComment", //发送请求地址
		data:{ //发送给数据库的数据
		},
		//请求成功后的回调函数有两个参数
		success:function(data,textStatus){
			 var dataobj = eval("("+data+")");
			 var ss = "";
			 for(var i=0;i<dataobj.length;i++){
				 ss = ss+"<li><span><a href='<%=path %>/getUserIndexById?userid="+dataobj[i].commenterid+"' target='_blank'>"+dataobj[i].commentername+"</a>在文章<a href='<%=path %>/viewTripMemoryDetail?memoryid="+dataobj[i].passageid+"' target='_blank'>"+dataobj[i].passagetitle+"</a>中回复了你</span></li>";
			 }
			 $('#commentminiin').html(ss);
			 $('#reflectnuminit').html("("+dataobj.length+")");
		}
	});
}


//===========================
</script>
<body>
	<div id="logo">
		<h1><a href="javascript:void(0);">驴友天地</a></h1>
		<p><em>design by team Forever</em></p>
	</div>
	<hr />
	<!-- end #logo -->
	<div id="header">
		<div id="menu">
			<ul>
				<li><a href="<%=path %>/page/index.jsp" class="first">首页</a></li>
				<li><a href="<%=path %>/page/myindex.jsp">我的</a></li>
				<li><a href="<%=path %>/page/friend.jsp">好友&nbsp;</a></li>
				<li><a href="<%=path %>/page/follow.jsp">关注&nbsp;</a></li>
				<li><a href="<%=path %>/page/together.jsp">结伴游</a></li>
				<li><a href="<%=path %>/page/personal.jsp">个人中心</a></li>
			</ul>
		</div>
		<!-- end #menu -->
		<div id="search">
			<form method="get" action="">
				<fieldset>
				<input type="text" name="s" id="search-text" size="15" />
				<input type="submit" id="search-submit" value="GO" />
				</fieldset>
			</form>
		</div>
		<!-- end #search -->
	</div>
	<!-- end #header -->
	<!-- end #header-wrapper -->
	<div id="page">
		<div id="content" style="height:1000px;">	
			<p style="text-align: center;">
				<img id="bee" src="<%=path %>/images/bee.jpg" alt="Busy bee" title="Busy bee" />
			</p>
		</div><!-- end #content -->
		<div id="sidebar">
			<ul>
			<li id="userinfo" style="height:200px;display:block;">
					<img class="nameimg" src="<%=path %>/images/test.png" />
					<a href="javascript:void(0);"><span id="name">赵安卡</span></a>
					<div id="userintro">
						<p><input type="button" id="sixin" value="私信" /></p>
						<p>北京,海淀</p>
						<p>email@bjtu.edu.cn</p>
					</div>
					<div id="shortintro">
						<p>爱好：编程序</p>
						<p>签名：喜欢旅行带来的好心情</p>
						<br /><input type="button" value="发布旅游记忆" style="margin-left:30px;" onclick="writememo()" />
							<input type="button" value="发布结伴游信息" onclick="writetog()" />
					</div>
				</li>
				<li style="list-style-type:none;">
					<h2>热门旅游记忆</h2>
					<ul id="hot">
						<li><a href="javascript:void(0);">Nec metus sed donec</a></li>
						<li><a href="javascript:void(0);">Magna lacus bibendum mauris</a></li>
						<li><a href="javascript:void(0);">Velit semper nisi molestie</a></li>
						<li><a href="javascript:void(0);">Eget tempor eget nonummy</a></li>
						<li><a href="javascript:void(0);">Nec metus sed donec</a></li>
						<li><a href="javascript:void(0);">Velit semper nisi molestie</a></li>
						<li><a href="javascript:void(0);">Eget tempor eget nonummy</a></li>
						<li><a href="javascript:void(0);">Nec metus sed donec</a></li>
					</ul>
				</li>
				<li style="list-style-type:none;">
					<h2>驴友之星</h2>
					<div>
					<ul id="stars">
						
						<li>
							<div class="substars">
								<img src="<%=path %>/images/test2.png" />
								<div class="starsintro">
									<a href="javascript:void(0);">Nec metus sed donec</a><br />
									<span>关注:1314</span><br />
									<span>喜欢骑自行车</span>
								</div>
							</div>
						</li>
						<li>
							<div class="substars">
								<img src="<%=path %>/images/test2.png" />
								<div class="starsintro">
									<a href="javascript:void(0);">Nec metus sed donec</a><br />
									<span>关注:1314</span><br />
									<span>喜欢骑自行车</span>
								</div>
							</div>
						</li>
						<li>
							<div class="substars">
								<img src="<%=path %>/images/test2.png" />
								<div class="starsintro">
									<a href="javascript:void(0);">Nec metus sed donec</a><br />
									<span>关注:1314</span><br />
									<span>喜欢骑自行车</span>
								</div>
							</div>
						</li>
						<li>
							<div class="substars">
								<img src="<%=path %>/images/test2.png" />
								<div class="starsintro">
									<a href="javascript:void(0);">Nec metus sed donec</a><br />
									<span>关注:1314</span><br />
									<span>喜欢骑自行车</span>
								</div>
							</div>
						</li>
						<li>
							<div class="substars">
								<img src="<%=path %>/images/test2.png" />
								<div class="starsintro">
									<a href="javascript:void(0);">Nec metus sed donec</a><br />
									<span>关注:1314</span><br />
									<span>喜欢骑自行车</span>
								</div>
							</div>
						</li>
						<li>
							<div class="substars">
								<img src="<%=path %>/images/test2.png" />
								<div class="starsintro">
									<a href="javascript:void(0);">Nec metus sed donec</a><br />
									<span>关注:1314</span><br />
									<span>喜欢骑自行车</span>
								</div>
							</div>
						</li>
					</ul>
				</div>
				</li>
			</ul>
		</div>
		<!-- end #sidebar -->
		<div style="clear: both;">&nbsp;</div>
	</div>
	<!-- end #page -->
	<div id="footer">
		<p>All rights reserved. Design by team Forever.</p>
	</div>
	<!-- end #footer -->
	<div id="personalnav">
		<ul>
			<li>
				<span onclick="opensxmini()"><a href="javascript:void(0)">私信</a></span><span>(2)</span>
			</li>
			<li>
				<span onclick="opencommentmini()"><a href="javascript:void(0)">回复</a></span><span id="reflectnuminit"></span>
			</li>
		</ul>
	</div>
	<div id="sxmini">
		<ul>
			<li>
				<span><a href="otherindex.jsp" target="_blank">赵安卡</a>来信<a href="detail.jsp" target="_blank">你好我想认识你</a></span>
			</li>
			<li>
				<span><a href="otherindex.jsp" target="_blank">赵安卡</a>来信<a href="detail.jsp" target="_blank">你好我想认识你</a></span>
			</li>
			<li>
				<span><a href="otherindex.jsp" target="_blank">赵安卡</a>来信<a href="detail.jsp" target="_blank">你好我想认识你</a></span>
			</li>
			<li>
				<span><a href="otherindex.jsp" target="_blank">赵安卡</a>来信<a href="detail.jsp" target="_blank">你好我想认识你</a></span>
			</li>
			<li>
				<span><a href="otherindex.jsp" target="_blank">赵安卡</a>来信<a href="detail.jsp" target="_blank">你好我想认识你</a></span>
			</li>
			<li>
				<span><a href="otherindex.jsp" target="_blank">赵安卡</a>来信<a href="detail.jsp" target="_blank">你好我想认识你</a></span>
			</li>
			<li>
				<span><a href="otherindex.jsp" target="_blank">赵安卡</a>来信<a href="detail.jsp" target="_blank">你好我想认识你</a></span>
			</li>
			<li>
				<span><a href="otherindex.jsp" target="_blank">赵安卡</a>来信<a href="detail.jsp" target="_blank">你好我想认识你</a></span>
			</li>
		</ul>
	</div>
	<div id="commentmini">
		<ul>
			<li>
				<span><a href="otherindex.jsp" target="_blank">赵安卡</a>在<a href="detail.jsp" target="_blank">北京三日游</a>中回复了你</span>
			</li>
			<li>
				<span><a href="otherindex.jsp" target="_blank">赵安卡</a>在<a href="detail.jsp" target="_blank">北京三日游</a>中回复了你</span>
			</li>
			<li>
				<span><a href="otherindex.jsp" target="_blank">赵安卡</a>在<a href="detail.jsp" target="_blank">北京三日游</a>中回复了你</span>
			</li>
			<li>
				<span><a href="otherindex.jsp" target="_blank">赵安卡</a>在<a href="detail.jsp" target="_blank">北京三日游</a>中回复了你</span>
			</li>
			<li>
				<span><a href="otherindex.jsp" target="_blank">赵安卡</a>在<a href="detail.jsp" target="_blank">北京三日游</a>中回复了你</span>
			</li>
			<li>
				<span><a href="otherindex.jsp" target="_blank">赵安卡</a>在<a href="detail.jsp" target="_blank">北京三日游</a>中回复了你</span>
			</li>
			<li>
				<span><a href="otherindex.jsp" target="_blank">赵安卡</a>在<a href="detail.jsp" target="_blank">北京三日游</a>中回复了你</span>
			</li>
		</ul>
	</div>
	<div id="sxminiclo" onclick="closesxmini()"><img src="<%=path %>/images/closebtn.png"  /></div>
	<div id="commentminiclo" onclick="closecommentmini()"><img src="<%=path %>/images/closebtn.png"  /></div>

</body>
</html>
